#pragma once

#include "Client.h"
#include "Server.h"

namespace cat
{
	class App
	{

	private:

		static App _current;

		net::Client* _client = nullptr;
		net::Server* _server = nullptr;

	public:
		App();
		~App();

		// Gets the current Application instance
		static App& getCurrent();

		// Gets the current client instance if it has been defined
		net::Client& getClient(); 

		// Gets the current server instance if it has been defined
		net::Server& getServer();

		// Determines whether an accessible server isntance exists
		bool hasServer() { return _server != nullptr; }

		// Determines whether the application is currently running
		bool isRunning() { return _client != nullptr; }

		void Run();
		void Stop();
		net::Server& CreateServer();
		void StopServer();
	};
}